﻿# 20130606
# VMWare View 5.2
# This script creates a role for VMWare View Local Mode to operate in vCenter.
#
# Refer to the documentation
# http://pubs.vmware.com/view-52/index.jsp?topic=%2Fcom.vmware.view.installation.doc%2FGUID-A878F876-B359-42FC-9124-A1E34BFB3319.html&resultof=%22%41%63%74%22%20%22%61%63%74%22%20%22%76%63%65%6e%74%65%72%22%20%22%73%65%72%76%65%72%22%20

# Include any helper functions
. ".\include\*.ps1"

# Include any predefined variables
. ".\configuration.ps1"

# Name for our role
$myRole = "ViewLocalModeRole"

# Remove the role before trying to create it
removeRole($myRole)

# Create our role
new-virole -Name $myRole

# Privileges needed for the View Composer Role
$myGuestPrivileges = @("Manage custom attributes", "Set custom attribute", "System management")

# Set basic privs
set-virole -Role $myRole -AddPrivilege $myGuestPrivileges
